package com.ts.api.module.common.service.impl;

import com.ts.api.http.user.phone.JstzPhoneStatusProvider;
import com.ts.api.module.common.entity.bo.CheckPhoneStatusBO;
import com.ts.api.module.common.service.UserPhoneAuthService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class UserPhoneAuthServiceImpl implements UserPhoneAuthService {

    @Autowired
    private JstzPhoneStatusProvider jstzPhoneStatusProvider;

    @Override
    public CheckPhoneStatusBO checkPhoneStatus(String phone) {
        try {
            return jstzPhoneStatusProvider.checkPhoneStatus(phone);
        } catch (Exception e) {
            //  异常状态
            CheckPhoneStatusBO checkPhoneStatusBO = new CheckPhoneStatusBO();
            checkPhoneStatusBO.setPhoneStatus("100");
            return checkPhoneStatusBO;
        }
    }
}
